import React from 'react';
import Loadable from '@/components/Loadable';
import { IconHome, IconList, IconEmoji, IconCustomerSupport } from '@douyinfe/semi-icons';
import { MenuRouteObject } from '@/types/router';

const NotFoundComponent = Loadable(() => import('@/components/NotFound'));

const ServiceManagementPage = Loadable<{}>(() => import('@/pages/ServiceManagement'));

const FieldsCitiesListPage = Loadable<{}>(() => import('@/pages/ServiceManagement/FieldsCities/List'));
const FieldsGoodListPage = Loadable<{}>(() => import('@/pages/ServiceManagement/FieldsGoods/List'));
const FieldsGoodsServicesPage = Loadable<{}>(() => import('@/pages/ServiceManagement/FieldsGoodsServices/List'));
const FieldsGoodsServicesDetailPage = Loadable<{}>(() => import('@/pages/ServiceManagement/FieldsGoodsServices/Detail'));

export const serviceRoute: MenuRouteObject = {
  title: '业务管理',
  path: 'service',
  fullpath: '/service',
  icon: <IconCustomerSupport />,
  element: <ServiceManagementPage />,
  children: [
    {
      title: '一线通类目管理',
      path: 'fields-goods',
      fullpath: '/service/fields-goods',
      element: <FieldsGoodListPage />,
      icon: <IconList />,
    },
    {
      title: '一线通城市管理',
      path: 'fields-cities',
      fullpath: '/service/fields-cities',
      element: <FieldsCitiesListPage />,
      icon: <IconHome size="large" />,
    },
    {
      title: '一线通类目服务管理',
      path: 'fields-goods-services',
      fullpath: '/service/fields-goods-services',
      element: <FieldsGoodsServicesPage />,
      icon: <IconEmoji />,
    },
    {
      title: '一线通类目服务管理详情',
      path: 'fields-goods-services/detail',
      fullpath: '/service/fields-goods-services/detail',
      element: <FieldsGoodsServicesDetailPage />,
      hide: true,
    },
    {
      title: '一线通类目服务管理创建',
      path: 'fields-goods-services/create',
      fullpath: '/service/fields-goods-services/create',
      element: <FieldsGoodsServicesDetailPage />,
      hide: true,
    },
    {
      title: '一线通类目服务管理更新',
      path: 'fields-goods-services/update',
      fullpath: '/service/fields-goods-services/update',
      element: <FieldsGoodsServicesDetailPage />,
      hide: true,
    },
    {
      path: '*',
      title: '服务页面暂未开发，敬请期待',
      element: <NotFoundComponent message={'暂未开发'} />,
    },
  ],
};
